<?php ob_start(); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<meta HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
    <?php 
      include 'color_style.php';
      require_once('../classDB.inc.php');
      include LANGUAGE;
      echo '<meta http-equiv="Content-Type" content="text/html; charset='._CHARSET_.';">'; 
    ?>

    <title><?php print SPD_DETAIL; ?></title>

    <style  type="text/css"><!--
                table{
                    border-bottom-color: black;
                    border-top-color: black;
                    border-left-color: black;
                    border-right-color: black;
                    border-collapse: collapse;
                    font-size: 12px;
                }
                form {margin-top:0pt; margin-bottom:0px;}
                img {margin-top:0pt; margin-bottom:0px;}
                body{
	                    margin-left:10pt;
	                    margin-right:10pt;
	                    margin-top:10pt;
	                    margin-bottom:10pt;
	                    font-family:  Verdana;
	                    font-size: 14px;
                }
                input {
                        border: 1px solid black;
	                    cursor: pointer;
	                    background-color: white;
	                    font-size: 10px;
	                    margin-left: 0px;
	                    padding-left: 0px;
	                    list-style-type: none;
	                    font-family:  Verdana;
                }
                textarea{
						width: 300px;
						height:150px;
						border: 1px solid;
						font-size: 10px;
	                    margin-left: 0px;
	                    padding-left: 0px;
	                    font-family:  Verdana;
                }
                h3 {
                    	font-size: 14px;
                        font-family: Verdana;
                        text-align: center;
                }

        --></style>

</head>

<?php

print"<body bgcolor=\"".Background_Color."\" onload=\"this.focus();\">";
require_once('functs.inc');
do
{
    $_DB = new classDB();
    if ($_DB->open()){echo OPEN_DB_ERR; break;}

    $ID     = $_REQUEST["ID"];
    $Count  = $_REQUEST["Count"];


    if($ID==""){mysql_close(); break;}

    $sql_psel=  "SELECT * FROM products WHERE ID=".$ID;
    $Product_source = mysql_query($sql_psel);

        $sql_array_Prodct = mysql_fetch_object($Product_source);



    print "<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" width=\"98%\" bgcolor=".TR_BACKGOUND_COLOR_1."
                    style=\"border-bottom-color: black; border-top-color: black; border-left-color: black;
                                    border-right-color: black; border-collapse: collapse; font-size: 10px;\">";
    //zobrazenie nazvu, kodu, obrazka a popisu
    $image_name ="admin/img/".$sql_array_Prodct->ID."mini.jpg";
    $image_name_big ="admin/img/".$sql_array_Prodct->ID.".jpg";
    print "<tr><td>";
        //$image_name ="admin/img/".$sql_array_Prodct->ID.".jpg";
            print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" bgcolor=\"".TR_BACKGOUND_COLOR_1."\">";
        print "<tr><td>";
          //if (file_exists($image_name)) print "<img  src=\"".$image_name."\" align=\"left\" vspace=\"0px\">";
          if (file_exists($image_name))
                          print "<input type=\"image\" name=\"picture\" align=\"left\" src=\"".$image_name."\" value=\"Button\"  onClick=\"javascript:window.open('image_show.php?image_name_big=".$image_name_big."','Image','width=680px,height=500px,location=no,directories=no,menubar=no,resizeable=yes,status=no,toolbar=no,scrollbars=yes');\" />";

          print "<b><u>".$sql_array_Prodct->Product_Name."</u></b>";
                  print " [".SPD_KOD.":".$sql_array_Prodct->Product_Code."]";
                  print "<br /><br />";
          print($sql_array_Prodct->Product_Descr);
           //************************modul tables********************************
		//**************************************************************************
		//**************************************************************************
		if(file_exists("admin/modules/tables/insert_6.inc"))  
		{
		  include('admin/modules/tables/insert_6.inc');	
		}
		//**************************************************************************
		//**************************************************************************
		//**************************************************************************
        print "</td></tr></table>";
    print "</td></tr>";

//************************modul discount********************************
//**************************************************************************
//**************************************************************************      
		$discount=1;  
	     if (file_exists("admin/modules/discount/discount.inc"))
			{	
		   		require_once ('admin/modules/discount/discount.inc'); 
	        		//print "xxx".Discount($ProductID)."xxx";
	        		$discount=Discount($sql_array_Prodct->ID);  
	     	}   
//************************modul discount********************************
//**************************************************************************
//**************************************************************************
    //zobrazenie informacii
            print "<tr><td style=\"border-top:1px solid ".TR_BACKGOUND_COLOR_2."\">";
                    print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" bgcolor=\"".TR_BACKGOUND_COLOR_1."\">";
                        print "<td>".SPD_CENA.":<b>";
                        	if(PAYER_VAT=="YES")
	                          //**********************************************************************
	                          //platca DPH
	                          print FormatItAsCurrency($sql_array_Prodct->Product_Price*$discount).",-".SPD_MENA_BEZ_DPH."<b>";
	                          //**********************************************************************
	                        else
	                          //**********************************************************************
	                          //neplatca DPH
	                          print FormatItAsCurrency($sql_array_Prodct->Product_Price*$discount).",-".SPD_MENA."<b>";
	                          //**********************************************************************
                          
                          switch($sql_array_Prodct->Product_Availability){
                           case 0:print   "<font color=\"black\" ><small> ...[".SPD_NIE_JE_NA_SKLADE."]</small></font color>";break;
                           case 1:print   "<font color=\"black\" ><small> ...[".SPD_JE_NA_SKLADE."]</small></font color>";break; }
                        print "</td>";
                        print "<td valign=\"left\" width=\"200px\">";
                          print SPD_VYBRANE_MNOZSTVO.": <b>".$Count." ".$sql_array_Prodct->Product_UnitType."</b>";;
                        print "</td>";
                print "</table>";
    print "</td></tr>";
    
    if(PAYER_VAT=="YES"){
	    //**********************************************************************
	    //platca DPH
	    print "<tr><td style=\"border-top:1px solid ".TABLE_IN_BASKET_PROD_SHOW."\">";
	                    print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" bgcolor=\"".TR_BACKGOUND_COLOR_1."\" />";
	                        print "<td>".SPD_CENA_CELKOM_BEZ_DPH.":</td>";
	                        print "<td valign=\"left\" width=\"200px\">";
	                          print "<b>".FormatItAsCurrency($sql_array_Prodct->Product_Price*$Count*$discount).",-".SPD_MENA."</b>";;
	                        print "</td>";
	                print "</table>";
	    print "</td></tr>";
	        print "<tr><td style=\"border-top:1px solid ".TABLE_IN_BASKET_PROD_SHOW."\">";
	                    print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" bgcolor=\"".TR_BACKGOUND_COLOR_1."\" />";
	                        print "<td>".SPD_CENA_CELKOM_VRATANE_DPH.":</td>";
	                        print "<td valign=left width=\"200px\">";
	                          print "<b>".RoundIt(((($sql_array_Prodct->Product_DPH)/100)+1) * $sql_array_Prodct->Product_Price * $Count * $discount) .",-".SPD_MENA."</b>";;
	                        print "</td>";
	                print "</table>";
	    print "</td></tr>";
	    //**********************************************************************
	}
	else{
	    //**********************************************************************
	    //neplatca DPH
	    print "<tr><td style=\"border-top:1px solid ".TR_BACKGOUND_COLOR_2."\">";
	                    print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" bgcolor=\"".TR_BACKGOUND_COLOR_1."\" />";
	                        print "<td>".SPD_CENA_CELKOM.":</td>";
	                        print "<td valign=\"left\" width=\"200px\">";
	                          print "<b>".RoundIt($sql_array_Prodct->Product_Price * $Count * $discount) .",-".SPD_MENA."</b>";;
	                        print "</td>";
	                print "</table>";
	    print "</td></tr>";
	    //**********************************************************************
	}

    print "</table>";
    print "<input type=\"hidden\" name=\"ID_product\" value=\"".$ProductID."\" />";

    //tlacitko "ZAVRIET"
    print "
        <br />
        <input type=\"button\" value=\"".SPD_ZAVRIET."\"
            style=\"width :183px; height:15px; background-color: ".BUTTON_ON_OUT.";\"
            onClick=\"javascript:window.close()\"
            onmouseover=\"this.style.backgroundColor='".BUTTON_ON_OVER."'; this.style.fontWeight='bold'\"
            onmouseout=\"this.style.backgroundColor='".BUTTON_ON_OUT."'; this.style.fontWeight='normal'\"
        />
    ";

}while(false);
?>
</body>
</html>